package com.wq.wrongquestion.serviceimpl.phy;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wq.wrongquestion.entity.phy.PhysicsEntity;
import com.wq.wrongquestion.mapper.phy.PhysicsMapper;
import com.wq.wrongquestion.service.phy.PhysicsService;

@Component
public class PhysicsServiceimpl implements PhysicsService {
    
    @Autowired
    public PhysicsMapper PhysicsMapper;
    @Override
    @Transactional
    public String getPhysicsZjnm(String zjID) {
        String zjNm=PhysicsMapper.getPhysicsZjnm(zjID);
        return zjNm;
    }
    @Override
    @Transactional
    public List<String> getPhysicsZjID() {
       List<String> allZjID=PhysicsMapper.getPhysicsZjID();
       return allZjID;
    }
    @Override
    @Transactional
    public List<String> getPhysicsZj() {
        List<String> zjInfo=PhysicsMapper.getPhysicsZj();
        return zjInfo;
    }
    @Override
    @Transactional
    public void insPhysics(PhysicsEntity PhysicsEntity) {
        PhysicsMapper.insPhysics(PhysicsEntity);
    }
    @Override
    @Transactional
    public PageInfo<PhysicsEntity> getPhysics(Integer pageNumer,Integer pageSize,PhysicsEntity PhysicsEntity) {
        PageHelper.startPage(pageNumer, pageSize);
        List<PhysicsEntity> Physics=PhysicsMapper.getPhysics(PhysicsEntity);
        PageInfo<PhysicsEntity> pagePhysics=new PageInfo<>(Physics);
        return pagePhysics;
    }

    @Override
    @Transactional
    public List<PhysicsEntity> getPhysicsByID(Integer id) {
        List<PhysicsEntity> Physics=PhysicsMapper.getPhysicsByID(id);
        return Physics;
    }
    @Override
    @Transactional
    public Integer updPhysics(PhysicsEntity PhysicsEntity) {
        return PhysicsMapper.updPhysics(PhysicsEntity);
    }
    @Override
    @Transactional
    public Integer delPhysics(Integer id) {
        return PhysicsMapper.delPhysics(id);
    }
    
}
